package com.mexico.inloancash.dialog;


import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.mexico.inloancash.R;
import com.mexico.inloancash.india_interfacedai.IndiaDealDialogInterface;


/**
 * 修改用户银行卡号
 */
public class India_Update_BankNumber_Dialog extends Dialog {

    private Button dialog_bottom;

    private TextView cancel;

    private Context context;

    private IndiaDealDialogInterface anInterface;

    public India_Update_BankNumber_Dialog(@NonNull Context context, IndiaDealDialogInterface dialogInterface) {
        super(context, R.style.MyDialog);
        this.context = context;
        this.anInterface = dialogInterface;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.india_auth_view_dialog_mmp);
        Window win = getWindow();
        win.setGravity(Gravity.CENTER);
        WindowManager.LayoutParams lp = win.getAttributes();
        lp.width = WindowManager.LayoutParams.WRAP_CONTENT;
        lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
        win.setAttributes(lp);
        setCanceledOnTouchOutside(false);
        cancel = findViewById(R.id.cancel);
        dialog_bottom = findViewById(R.id.dialog_bottom);
        cancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                anInterface.choose();
                dismiss();
            }
        });
        dialog_bottom.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                anInterface.doPlay();
                dismiss();
            }
        });
    }
}
